package com.smartticket.jeju.repository;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Component;

import com.smartticket.jeju.model.Sight;

@Component
@Qualifier("sightRowMapper")
public class SightRowMapper implements RowMapper<Sight> 
{
	public Sight mapRow(final ResultSet rs, final int rowNum) throws SQLException 
	{
		Sight sight = new Sight();
		sight.setId(rs.getInt("id"));
		sight.setName(rs.getString("name"));
		sight.setDescription(rs.getString("description"));
		sight.setImage_url(rs.getString("image_url"));
		sight.setLatitude(rs.getLong("latitude"));
		sight.setLongitude(rs.getLong("longitude"));
		
		return sight;
	}
}